<template>
  <div class="word">
    <!-- <h1>我是博文列表</h1> -->
    <el-form ref="form" :model="form" label-width="0px">
      <el-form-item label="">
        <el-input
          type="textarea"
          class="input"
          @keyup.enter.native="submit"
          v-model="form.desc"
          placeholder="请在这里写你的话，回车键发布"
        >
        
        </el-input>
      
      <el-upload
      ref="pictureUpload"
          action="#"
  list-type="picture-card"
  :auto-upload="false">
    <i slot="default" class="el-icon-plus"></i>
    <div slot="file" slot-scope="{file}">
      <img
        class="el-upload-list__item-thumbnail"
        :src="file.url" alt=""
      >
      <span class="el-upload-list__item-actions">
        <span
          class="el-upload-list__item-preview"
          @click="handlePictureCardPreview(file)"
        >
          <i class="el-icon-zoom-in"></i>
        </span>
        <span
          v-if="!disabled"
          class="el-upload-list__item-delete"
          @click="handleDownload(file)"
        >
          <i class="el-icon-download"></i>
        </span>
        <span
          v-if="!disabled"
          class="el-upload-list__item-delete"
          @click="handleRemoove(file)"
        >
          <i class="el-icon-delete"></i>
        </span>
      </span>
    </div>
        </el-upload>
        <el-dialog :visible.sync="dialogVisible">
          <img width="100%" :src="dialogImageUrl" alt="" />
        </el-dialog>
      </el-form-item>
     
    </el-form>
  </div>
</template>

<script>
export default {
  name: "Bowen",
  data() {
    return {
      form: {},
      dialogImageUrl: "",
       disabled: false,
       dialogVisible:false
    };
  },
  methods: {
    submit(){
console.log('玫瑰花的葬礼');
    },
    handleRemoove(file, fileList) {
      console.log(  this.$refs.pictureUpload);
      this.$refs.pictureUpload.handleRemove(file);
      
    },
    handlePictureCardPreview(file) {
      this.dialogImageUrl = file.url;
      this.dialogVisible = true;
    },
    handleDownload(file){
 console.log(file);
    }
  },
};
</script>

<style lang="scss" rel="stylesheet/scss">
.word {
  height: 100vh;
  width: 50%;
  color: #fff;
  background-color: black;
  padding: 10px;
}
.input textarea {
  display: block;
  height: 50vh;
  border: none;
  padding: 20px;
  color: #fff;
  background-color: rgba(0, 0, 0, 1);
}
.el-upload.el-upload--picture-card{
    background-color:rgba(0, 0, 0, 0.1);
    background-image: url('../../zhu/image/1111254.jpg');
    background-position: 50%;
    border: none;
    margin-left: 20px;
    // background-size: 50%;
}
</style>